<?php
/**
 * CreateTime: 2023/7/13 15:47
 */

namespace App\Models\AdminStaff;

use App\Consts\TableConsts\TableConsts;
use App\Models\BaseModelAdminV1;
use App\Models\BaseModelV2;
use App\Scopes\MediationStaffScope;

class AdminStaffModel extends BaseModelAdminV1
{
    protected $table = TableConsts::ADMIN_STAFF;

    protected $primaryKey = 'admin_id';

    protected $fillable = [
        'admin_id',
        'name',
        'account',
        'company_id',
        'password',
        'phone_number',
        'created_time',
        'updated_time',
        'email',
        'last_login_time',
    ];

    public function getAdminStaffInfoByAdminAccount($account){
        return $this->where('company_id',1)->where('account',$account)->first();
    }

    /**
     * 覆写全局作用域
     */
    protected static function booted()
    {
//        static::addGlobalScope(new MediationStaffScope());
    }


}